#ifndef CAN_H
#define CAN_H

#include <linux/can.h>
#include <linux/can/raw.h>

#define CMD_SET_CAN0_BITRATE     "ip link set can0 type can bitrate 500000 triple-sampling on"
#define CMD_CAN0_UP              "ifconfig can0 up"
#define CMD_CAN0_DOWN            "ifconfig can0 down"

#define CMD_SET_CAN1_BITRATE     "ip link set can1 type can bitrate 500000 triple-sampling on"
#define CMD_CAN1_UP              "ifconfig can1 up"
#define CMD_CAN1_DOWN            "ifconfig can1 down"

int can_set_controller(char *can_name);
int receive_can_message(int can_fd, struct can_frame *rx_frame);

#endif
